/*
 * This is the stylsheet for intexHTML's background. The look I'm going for is a dark background.
 * I found a snippet on the web, for an inline vector graphic, that looks like asphalt. Then I
 * layered some "lighting" on top of it. For that, I just kept trying different combinations of
 * CSS gradients until I got a decent-looking effect. Both "layers" are achieved in one rule.
 * 
 * Tested on Chrome Version 26.0.1410.43 and Firefox 20
 *
 * For info on how to make radial gradients:
 * http://msdn.microsoft.com/en-us/library/windows/apps/jj150651.aspx
 * 
 * Online gradient generator:
 * http://ie.microsoft.com/testdrive/graphics/cssgradientbackgroundmaker/
 */

#include "BackgroundDecoration.hpp"


webpages::resources::BackgroundDecoration::BackgroundDecoration()
    :

Wt::WCssTextRule("body",
"background-image:" /* Set background-image on <body> */
    /*
    * Add multiple gradients to give an effect of lights shining on the SVG background image (below).    
    */
    "radial-gradient(farthest-side ellipse at 88% 0%,"      /* -A nice location (highlight the top left window_box)  */
    "rgba(160, 160, 160, .4),"                              /* -A shade of gray, mostly transparent.                 */
    "rgba(160, 160, 160, .1),"                              /* -Smooth out the lighting.                             */
    "rgba(160, 160, 160, .1),"                              /* -Blend in "light" even more.                          */
    "rgba(0, 0, 0, 0)),"                                    /* -Last element in the gradient is totally transparent. */

// Inline SVG image. It creates an "ashpalt" look to give the background some texture.
"url(\"data:image/svg+xml;"
    "base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5r"
    "PSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMzAwIiBoZWlnaHQ9IjMwMCI"
    "+CjxmaWx0ZXIgaWQ9Im4iIHg9IjAiIHk9IjAiPgo8ZmVUdXJidWxlbmNlIHR5cGU9ImZyYWN0YW"
    "xOb2lzZSIgYmFzZUZyZXF1ZW5jeT0iMC43IiBudW1PY3RhdmVzPSIxMCIgc3RpdGNoVGlsZXM9I"
    "nN0aXRjaCI+PC9mZVR1cmJ1bGVuY2U+CjwvZmlsdGVyPgo8cmVjdCB3aWR0aD0iMzAwIiBoZWln"
    "aHQ9IjMwMCIgZmlsbD0iIzAwMCI+PC9yZWN0Pgo8cmVjdCB3aWR0aD0iMzAwIiBoZWlnaHQ9IjM"
    "wMCIgZmlsdGVyPSJ1cmwoI24pIiBvcGFjaXR5PSIwLjQiPjwvcmVjdD4KPC9zdmc+\");")
{}
